{% extends 'base.html' %}
 {% block bar %}
      <div class="col-md-9" style=  "justify-content: flex-end;">
            <h1 class="page-header">订单管理页面</h1>
            <div class="panel panel-primary">
                <!-- Default panel contents -->
                <div class="panel-heading">订单详情 <i class="fa fa-thumb-tack pull-right"></i></div>
                <div class="panel-body">
                    <div class="row" style="margin-bottom: 15px">

                        <div class="col-md-6 pull-left">
                            <a class="btn btn-success" href="/gold/add_order?id={{ customer_obj.id }}">新增明细</a>
                        </div>
                </div>
                </div>
 {% endblock %}

{% block main%}
    <div class="container-fluid">
    <div class="row-fluid">
    <div class="span12">
    <div style="display: flex;flex-wrap: wrap">

        <div style="width: 50%">
            <label style="width:80px;display:inline-block; text-align: left; ">订单号:</label>
            <span>{{ customer_obj.order_num }}</span>
        </div>
        <div style="width: 50%">
            <label style="width:80px;display:inline-block; text-align: left; ">客服姓名：</label>
            <span>{{ customer_obj.customer_name }}</span>
        </div>
        <div style="width: 50%">
            <label style="width:80px;display:inline-block; text-align: left; ">客户地址：</label>
            <span>{{ customer_obj.customer_adr }}</span>
        </div>
        <div style="width: 50%">
            <label style="width:80px;display:inline-block; text-align: left; ">送货日期：</label>
            <span>{{ customer_obj.delivery_time }}</span>
        </div>

    </div>
    <table border="1" class = "table table-hover table-bordered">
       <thead>
    <tr>
        <th>序号</th>
        <th>空间名称</th>
        <th>商品名称</th>
        <th>规格型号</th>
        <th>单位</th>
        <th>原单价</th>
        <th>成交单价</th>
        <th>面积</th>
        <th>数量</th>
        <th>成交金额</th>
        <th>备注</th>
        <th>操作</th>
    </tr>
    </thead>
 <tbody>

    {% for order_obj in order_list  %}
        <tr>
        <td>{{ forloop.counter }}</td>
        <td>{{ order_obj.space_name}}</td>
        <td>{{ order_obj.goods_id.goods_name }}</td>
        <td>{{ order_obj.goods_id.goods_type }}</td>
        <td>{{ order_obj.goods_id.unit }}</td>
        <td>{{ order_obj.goods_id.goods_price }}</td>
        <td>{{ order_obj.deal_unit }}</td>
        <td>{{ order_obj.area }}</td>
        <td>{{ order_obj.goods_nums }}</td>
        <td>{{ order_obj.deal_total }}</td>
        <td>{{ order_obj.remarks }}</td>

        <td>
             <a href="/gold/update_order?id={{ order_obj.id }}">修改</a>
             <a href="/gold/delete_order?id={{ order_obj.id }}">删除</a>
        </td>
        </tr>

  {% endfor %}

</tbody>
</table>
     <div style="display: flex;flex-wrap: wrap">
        <div style="width: 50%">
            <label style="width:80px;display:inline-block; text-align: left; ">合计金额:</label>
            <span>￥{{ total }}</span>
        </div>

    </div>
{% endblock %}

